package com.example.usb.ai;

import java.util.List;

/**
 * Created Date 2019/2/14
 *
 * @author liangkun
 * description：百度AI_V3实体类
 */
public class AiV3Bean {
    private int errorCode; //错误码
    private String errorMsg; //错误信息
    private long log_id;
    private int timestamp; //时间戳
    private int cached;
    private Result result; //返回结果集


    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public int getErrorCode() {
        return errorCode;
    }


    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getErrorMsg() {
        return errorMsg;
    }


    public void setLogId(long logId) {
        this.log_id = logId;
    }

    public long getLogId() {
        return log_id;
    }


    public void setTimestamp(int timestamp) {
        this.timestamp = timestamp;
    }

    public int getTimestamp() {
        return timestamp;
    }


    public void setCached(int cached) {
        this.cached = cached;
    }

    public int getCached() {
        return cached;
    }


    public void setResult(Result result) {
        this.result = result;
    }

    public Result getResult() {
        return result;
    }

    public class Result {
        private int face_num; //检测到的图片中的人脸数量
        private List<FaceList> face_list; //人脸信息列表，具体包含的参数参考下面的列表。


        public void setFaceNum(int faceNum) {
            this.face_num = faceNum;
        }

        public int getFaceNum() {
            return face_num;
        }


        public void setFaceList(List<FaceList> faceList) {
            this.face_list = faceList;
        }

        public List<FaceList> getFaceList() {
            return face_list;
        }
    }

    public class FaceList {

        private String face_token; //人脸图片的唯一标识
        private Location location; //人脸在图片中的位置
        private double face_probability; //人脸置信度，范围【0~1】，代表这是一张人脸的概率，0最小、1最大。
        private Angle angle; //人脸旋转角度参数
        private int age; //年龄 ，当face_field包含age时返回
        private double beauty; //美丑打分，范围0-100，越大表示越美。当face_fields包含beauty时返回
        private Expression expression;//表情，当 face_field包含expression时返回
        private FaceShape face_shape;//脸型，当face_field包含face_shape时返回
        private Gender gender; //性别，face_field包含gender时返回
        private Glasses glasses; //是否带眼镜，face_field包含glasses时返回
        private List<Landmark> landmark; //4个关键点位置，左眼中心、右眼中心、鼻尖、嘴中心。face_field包含landmark时返回
        private List<Landmark72> landmark72; //72个特征点位置 face_field包含landmark72时返回
        private Race race; //人种 face_field包含race时返回
        private Quality quality; //人脸质量信息。face_field包含quality时返回
        private FaceType face_type; //真实人脸/卡通人脸 face_field包含face_type时返回

        public class Quality {

            private Occlusion occlusion; //人脸各部分遮挡的概率，范围[0~1]，0表示完整，1表示不完整
            private double blur; //人脸模糊程度，范围[0~1]，0表示清晰，1表示模糊
            private double illumination; //取值范围在[0~255], 表示脸部区域的光照程度 越大表示光照越好
            private double completeness;//人脸完整度，0或1, 0为人脸溢出图像边界，1为人脸都在图像边界内


            public void setOcclusion(Occlusion occlusion) {
                this.occlusion = occlusion;
            }

            public Occlusion getOcclusion() {
                return occlusion;
            }


            public void setBlur(double blur) {
                this.blur = blur;
            }

            public double getBlur() {
                return blur;
            }


            public void setIllumination(double illumination) {
                this.illumination = illumination;
            }

            public double getIllumination() {
                return illumination;
            }


            public void setCompleteness(double completeness) {
                this.completeness = completeness;
            }

            public double getCompleteness() {
                return completeness;
            }

            public class Occlusion {


                private double left_eye; //0.6, #左眼被遮挡的阈值
                private double right_eye; //0.6, #右眼被遮挡的阈值
                private double nose; // 0.7, #鼻子被遮挡的阈值
                private double mouth; // 0.7, #嘴巴被遮挡的阈值
                private double left_cheek; //0.8, #左脸颊被遮挡的阈值
                private double right_cheek; //0.8, #右脸颊被遮挡的阈值
                private double chin_contour; // 0.6, #下巴被遮挡阈值


                public void setLeftEye(double leftEye) {
                    this.left_eye = leftEye;
                }

                public double getLeftEye() {
                    return left_eye;
                }


                public void setRightEye(double rightEye) {
                    this.right_eye = rightEye;
                }

                public double getRightEye() {
                    return right_eye;
                }


                public void setNose(double nose) {
                    this.nose = nose;
                }

                public double getNose() {
                    return nose;
                }


                public void setMouth(double mouth) {
                    this.mouth = mouth;
                }

                public double getMouth() {
                    return mouth;
                }


                public void setLeftCheek(double leftCheek) {
                    this.left_cheek = leftCheek;
                }

                public double getLeftCheek() {
                    return left_cheek;
                }


                public void setRightCheek(double rightCheek) {
                    this.right_cheek = rightCheek;
                }

                public double getRightCheek() {
                    return right_cheek;
                }


                public void setChinContour(int chinContour) {
                    this.chin_contour = chinContour;
                }

                public double getChinContour() {
                    return chin_contour;
                }

            }

            @Override
            public String toString() {
                return "Quality{" +
                        "occlusion=" + occlusion +
                        ", blur=" + blur +
                        ", illumination=" + illumination +
                        ", completeness=" + completeness +
                        '}';
            }
        }


        public class FaceType {

            private String type; //human: 真实人脸 cartoon: 卡通人脸
            private double probability; //人脸类型判断正确的置信度，范围【0~1】，0代表概率最小、1代表最大。


            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }


            public void setProbability(double probability) {
                this.probability = probability;
            }

            public double getProbability() {
                return probability;
            }

        }

        public void setFaceToken(String faceToken) {
            this.face_token = faceToken;
        }

        public String getFaceToken() {
            return face_token;
        }


        public void setLocation(Location location) {
            this.location = location;
        }

        public Location getLocation() {
            return location;
        }


        public void setFaceProbability(double faceProbability) {
            this.face_probability = faceProbability;
        }

        public double getFaceProbability() {
            return face_probability;
        }


        public void setAngle(Angle angle) {
            this.angle = angle;
        }

        public Angle getAngle() {
            return angle;
        }


        public void setAge(int age) {
            this.age = age;
        }

        public int getAge() {
            return age;
        }


        public void setBeauty(double beauty) {
            this.beauty = beauty;
        }

        public double getBeauty() {
            return beauty;
        }


        public void setExpression(Expression expression) {
            this.expression = expression;
        }

        public Expression getExpression() {
            return expression;
        }


        public void setFaceShape(FaceShape faceShape) {
            this.face_shape = faceShape;
        }

        public FaceShape getFaceShape() {
            return face_shape;
        }


        public void setGender(Gender gender) {
            this.gender = gender;
        }

        public Gender getGender() {
            return gender;
        }


        public void setGlasses(Glasses glasses) {
            this.glasses = glasses;
        }

        public Glasses getGlasses() {
            return glasses;
        }


        public void setLandmark(List<Landmark> landmark) {
            this.landmark = landmark;
        }

        public List<Landmark> getLandmark() {
            return landmark;
        }


        public void setLandmark72(List<Landmark72> landmark72) {
            this.landmark72 = landmark72;
        }

        public List<Landmark72> getLandmark72() {
            return landmark72;
        }


        public void setRace(Race race) {
            this.race = race;
        }

        public Race getRace() {
            return race;
        }


        public void setQuality(Quality quality) {
            this.quality = quality;
        }

        public Quality getQuality() {
            return quality;
        }


        public void setFaceType(FaceType faceType) {
            this.face_type = faceType;
        }

        public FaceType getFaceType() {
            return face_type;
        }

        public class Angle {

            private double yaw; //三维旋转之左右旋转角[-90(左), 90(右)]
            private double pitch; //三维旋转之俯仰角度[-90(上), 90(下)]
            private double roll; //平面内旋转角[-180(逆时针), 180(顺时针)]


            public void setYaw(double yaw) {
                this.yaw = yaw;
            }

            public double getYaw() {
                return yaw;
            }


            public void setPitch(double pitch) {
                this.pitch = pitch;
            }

            public double getPitch() {
                return pitch;
            }


            public void setRoll(double roll) {
                this.roll = roll;
            }

            public double getRoll() {
                return roll;
            }

        }

        public class Location {

            private double left; //人脸区域离左边界的距离
            private double top;  //人脸区域离上边界的距离
            private double width; //人脸区域的宽度
            private double height; //人脸区域的高度
            private double rotation; //人脸框相对于竖直方向的顺时针旋转角，[-180,180]


            public void setLeft(double left) {
                this.left = left;
            }

            public double getLeft() {
                return left;
            }


            public void setTop(double top) {
                this.top = top;
            }

            public double getTop() {
                return top;
            }


            public void setWidth(double width) {
                this.width = width;
            }

            public double getWidth() {
                return width;
            }


            public void setHeight(double height) {
                this.height = height;
            }

            public double getHeight() {
                return height;
            }


            public void setRotation(double rotation) {
                this.rotation = rotation;
            }

            public double getRotation() {
                return rotation;
            }

        }

        public class Expression {

            private String type; //none:不笑；smile:微笑；laugh:大笑
            private double probability; //表情置信度，范围【0~1】，0最小、1最大。


            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }


            public void setProbability(double probability) {
                this.probability = probability;
            }

            public double getProbability() {
                return probability;
            }

        }


        public class FaceShape {

            private String type; //square: 正方形 triangle:三角形 oval: 椭圆 heart: 心形 round: 圆形
            private double probability; //置信度，范围【0~1】，代表这是人脸形状判断正确的概率，0最小、1最大。


            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }


            public void setProbability(double probability) {
                this.probability = probability;
            }

            public double getProbability() {
                return probability;
            }

        }


        public class Gender {

            private String type; //male:男性 female:女性
            private double probability; //性别置信度，范围【0~1】，0代表概率最小、1代表最大。


            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }


            public void setProbability(double probability) {
                this.probability = probability;
            }

            public double getProbability() {
                return probability;
            }

        }


        public class Glasses {

            private String type; //none:无眼镜，common:普通眼镜，sun:墨镜
            private double probability; //眼镜置信度，范围【0~1】，0代表概率最小、1代表最大。


            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }


            public void setProbability(double probability) {
                this.probability = probability;
            }

            public double getProbability() {
                return probability;
            }

        }


        public class Landmark {
            private double x; //中心点x坐标
            private double y; //中心点y坐标


            public void setX(double x) {
                this.x = x;
            }

            public double getX() {
                return x;
            }


            public void setY(double y) {
                this.y = y;
            }

            public double getY() {
                return y;
            }

        }
//===========================


        public class Landmark72 {

            private double x; //中心点x坐标
            private double y; //中心点y坐标


            public void setX(double x) {
                this.x = x;
            }

            public double getX() {
                return x;
            }


            public void setY(double y) {
                this.y = y;
            }

            public double getY() {
                return y;
            }

        }


        public class Race {

            private String type; //yellow: 黄种人 white: 白种人 black:黑种人 arabs: 阿拉伯人
            private double probability; //人种置信度，范围【0~1】，0代表概率最小、1代表最大。


            public void setType(String type) {
                this.type = type;
            }

            public String getType() {
                return type;
            }


            public void setProbability(double probability) {
                this.probability = probability;
            }

            public double getProbability() {
                return probability;
            }

        }
    }

}
